package com.autonavi.yunda.yunji.core.enums;

import com.google.common.collect.Sets;
import lombok.Getter;

import java.util.Set;

/**
 * @author cizhong.wcs
 * @date 2022/2/14 3:07 下午
 */
public enum InterfaceStatus {
    INIT("编辑中", 3),
    VALIDATING("验证中", 3),
    TEST_SUCCESS("调试成功", 3),
    GRAY("灰度中", 2),
    PUBLISHED("已发布", 1),
    OFFLINE("已下线", 4);

    InterfaceStatus(String desc, Integer displayPriority) {
        this.desc = desc;
        this.displayPriority = displayPriority;
    }

    @Getter
    private final String desc;

    @Getter
    private final Integer displayPriority;

    static final Set<InterfaceStatus> publishing = Sets.newHashSet(GRAY, PUBLISHED);

    public boolean publishing() {
        return publishing.contains(this);
    }
}
